<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title></title>
    <script src='./vue.global.js'></script>
</head>
<body>
    <div id='app'>
        <my-component>
            <!-- 插入CPU信息在cpu插槽 -->
            <!-- v-slot:cpu="slotProps" cpu是具名插槽的名字 slotProps是【该插槽暴露出来的数据集】的别名 -->
            <template v-slot:cpu="slotProps">
                <h4>{{slotProps.myName}}{{slotProps.coreCount}}核处理器满足您打王者的需求</h4>
            </template>

            <!-- 插入其他信息在默认插槽 -->
            <template v-slot:default="sp2">
                <h6>我乃玉树临风技术碉堡小太保，江湖人称——【{{sp2.nickName}}】</h6>
            </template>

        </my-component>
    </div>

    <script>
        const app = Vue.createApp({
            data(){
                return {}
            },
            methods:{},
            computed:{}
        })

        app.component("my-component",{
            data(){
                return {
                    myName:"高通骁猪",
                    coreCount:8,
                    nickName:"BlackWind:逵哥"
                }
            },
            template:`
            <div>
                <h3>劳资是子组件</h3>
                
                <div class="cpu">
                    <!--子组件不单单暴露了插槽 还在插槽上附着了一些自己的数据-->
                    <slot name="cpu" :coreCount="coreCount" :myName="myName"></slot>
                </div>

                <div class="other">
                    <!--name="default"-->
                    <!--子组件不单单暴露了插槽 还在插槽上附着了一些自己的数据-->
                    <slot :nickName="nickName"></slot>
                </div>
            </div>
            `
        })

        app.mount('#app')
    </script>
</body>
</html>